﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Data;
using System.Windows.Forms;
using HFBizDBLib;

namespace HFBizPro
{
    public partial class xfLogin : HFBizFormLib.xfBase
    {
        private DataClassDataContext tdc;

        public xfLogin()
        {
            tdc = new DataClassDataContext();
            HFBizFormLib.xfBase.dlf.LookAndFeel.SkinName = "Stardust";
            InitializeComponent();
        }

        private void sbLogin_Click(object sender, EventArgs e)
        {
            var key = from p in tdc.BaseUsr
                      where p.UsrName == teUsrName.Text && p.Password == tePassWord.Text
                      select p;
            if (key.Count() == 1)
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show(this, "登录失败！");
            }
        }

        private void sbExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
